package com.ids.transfer.util;

import java.io.PrintStream;
import java.net.URL;
import org.w3c.dom.Element;

public class Resources {
	static Class Resources;
	private static URL resoucesURL;
	private static Element root;

	static Class class$(String a) {
		try {
			return Class.forName(a);
		} catch (ClassNotFoundException e) {
			throw new NoClassDefFoundError(e.getMessage());
		}
	}

	public static String getResource(String as_section, String as_tag) {
		if (root == null) {
			init();
		}

		return XmlUtils.getTagAttribute(root, as_section, as_tag);
	}

	public static String getParameter(String name) {
		if (root == null) {
			init();
		}

		return XmlUtils.getSubTagValue(root, "parameters", name);
	}

	public static Element getResourceRoot() {
		if (root == null) {
			init();
		}

		return root;
	}

	public static void init() {
	}

	public static void main(String[] args) {
		init();
		try {
			String test1 = getResource("datasource", "datasource_type");

			System.out.println(test1);
		} catch (Exception E) {
			E.printStackTrace();
		}
	}
}